package cn.sightsnow.zh.controller;

import cn.sightsnow.zh.repository.LocationRepository;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@Api(tags = "删除地点信息")
@RestController
@RequestMapping("/extension")
@Slf4j
public class ExtensionController {
    private final LocationRepository locationRepository;

    public ExtensionController(LocationRepository locationRepository) {
        this.locationRepository = locationRepository;
    }
    @ApiOperation("删除MongoDB所有地点信息")
    @DeleteMapping("/locations/all")
    public void DeleteLocationsALL() {
        log.info("删除MongoDB所有地点信息");
        locationRepository.deleteAll();
    }
}
